package TuiLayer;


import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import ModelLayer.*;

/**
 * The test class TuiTest.
 *
 * @author  (your name)
 * @version (a version number or a date)
 */
public class TuiTest
{
    private TuiLayer.PurchaseUI purchaseUI;
    private TuiLayer.LeaseUI leaseUI;
    private TuiLayer.CustomerUI customerUI;
    private TuiLayer.EmployeeUI employeeUI;
    private TuiLayer.ProductUI productUI;
    private TuiLayer.MachineryUI machineryUI;

    /**
     * Default constructor for test class TuiTest
     */
    public TuiTest()
    {
    }

    /**
     * Sets up the test fixture.
     *
     * Called before every test case method.
     */
    @Before
    public void setUp()
    {
        purchaseUI = new TuiLayer.PurchaseUI();
        leaseUI = new TuiLayer.LeaseUI();
        customerUI = new TuiLayer.CustomerUI();
        employeeUI = new TuiLayer.EmployeeUI();
        productUI = new TuiLayer.ProductUI();
        machineryUI = new TuiLayer.MachineryUI();
        
        createEmployees();
        createCustomers();
        createProducts();
        createMachinery();
        createUnits();
        createPurchases();
        createLeases();
        
    }

    /**
     * Tears down the test fixture.
     *
     * Called after every test case method.
     */
    @After
    public void tearDown()
    {
    }

    public void createEmployees() 
    {
        employeeUI.createEmployee("1111","DIY Employee", "TestAddress", "TestPhone", "TestMail");
        employeeUI.createEmployee("2222","Timber Employee", "TestAddress", "TestPhone", "TestMail");
        employeeUI.createEmployee("3333","Manager", "TestAddress", "TestPhone", "TestMail");
    }

    public void createCustomers() 
    {
        customerUI.createCustomer("0123", "Test Private Customer","TestAddress", "TestPhone", "TestMail", "private" );
        customerUI.createCustomer("0987", "Test Business Customer","TestAddress", "TestPhone", "TestMail", "business" );
    }

    public void createProducts() 
    {
        productUI.createProduct("00000000", "Black deck", "A black piece of wooden deck used for various kinds of stuff.", 100.00, 20, 200, 0, 25, "DIY store"); 
        productUI.createProduct("00000001", "White deck", "A white piece of wooden deck used for various kinds of stuff.", 100.00, 20, 200, 0, 25, "Timber store");
        productUI.createProduct("00000002", "Red deck", "A red piece of wooden deck used for various kinds of stuff.", 100.00, 20, 200, 0, 25, "DIY store");
        productUI.createProduct("00000003", "Green deck", "A green piece of wooden deck deck used for various kinds of stuff.", 100.00, 20, 200, 0, 25, "DIY store");
        productUI.createProduct("00000004", "Blue deck", "A blue piece of wooden deck deck used for various kinds of stuff.", 100.00, 20, 200, 0, 25, "Timber store");
    }

    public void createMachinery() 
    {
        machineryUI.createMachinery("11111111", "Carpetronix 3000", "Carpet cleaner", 300.00);
        machineryUI.createMachinery("11111112", "Vacuumax E125", "Vacuum cleaner", 200.00);
        machineryUI.createMachinery("11111113", "Forest Destroyer B100", "Chainsaw", 400.00);
    }
    
    public void createUnits() 
    {
        Machinery machinery1 = machineryUI.findMachinery("11111111");
        Unit unit11 = new Unit(machinery1, "11111111");               
        Unit unit12 = new Unit(machinery1, "11111112");
        machinery1.addUnit(unit11);
        machinery1.addUnit(unit12);
        
        Machinery machinery2 = machineryUI.findMachinery("11111112");
        Unit unit21 = new Unit(machinery2, "22222221");
        Unit unit22 = new Unit(machinery2, "22222222");
        machinery2.addUnit(unit21);
        machinery2.addUnit(unit22);
        
        Machinery machinery3 = machineryUI.findMachinery("11111113");
        Unit unit31 = new Unit(machinery3, "33333331");
        machinery3.addUnit(unit31);
    }

    public void createPurchases() 
    {

    }

    public void createLeases() 
    {
    
    }



    @Test
    public void testMethod()
    {
        TuiLayer.Menu menu1 = new TuiLayer.Menu();
    }
}



